package com.ruoyi.project.system.controller;

import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.system.domain.SiyuUserPrice;
import com.ruoyi.project.system.service.ISiyuUserPriceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**
 * 定制价格Controller
 * 
 * @author ruoyi
 * @date 2024-10-28
 */
@RestController
@RequestMapping("/system/price")
public class SiyuUserPriceController extends BaseController
{
    @Autowired
    private ISiyuUserPriceService siyuUserPriceService;

    /**
     * 新增定制价格
     */
    @PreAuthorize("@ss.hasPermi('system:price:add')")
    @Log(title = "定制价格", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody SiyuUserPrice siyuUserPrice)
    {
        return toAjax(siyuUserPriceService.insertSiyuUserPrice(siyuUserPrice));
    }

    /**
     * 修改定制价格
     */
    @PreAuthorize("@ss.hasPermi('system:price:edit')")
    @Log(title = "定制价格", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody SiyuUserPrice siyuUserPrice)
    {
        return toAjax(siyuUserPriceService.updateSiyuUserPrice(siyuUserPrice));
    }

}
